﻿<UserControl
 x:Class="WPFExcelReport.AB50LS"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
 >
    <UserControl.Resources>
        <ucd:TextTrimmingConverter x:Key="Trim"></ucd:TextTrimmingConverter>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:JWCONVERTER  x:Key="JW"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <CollectionViewSource  x:Key="vwGAAUF" Source="{Binding Path=SetEnv.GAAUF}" />
        <CollectionViewSource  x:Key="vwYARNA" Source="{Binding Path=SetMaster.GAAUF}" />
        <CollectionViewSource  x:Key="vwZUTEI" Source="{Binding Path=SetMaster.ZUTEI}" /> 
        <CollectionViewSource   x:Key="vwGLLG" Source="{Binding Path=SetMaster.GLLG}" />
        <CollectionViewSource  x:Key="vwTGAAUF" Source="{Binding Path=SetDetail.GAAUF}" />
        <CollectionViewSource  x:Key="vwTZUTEI" Source="{Binding Path=SetDetail.ZUTEI}" />
        <CollectionViewSource  x:Key="vwMU" Source="{Binding Path=SetEnv.ICC_ABAX}" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="1*" /> 
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0"   Grid.Column="1"   >
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="1*" />
                <RowDefinition   Height="1*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"></ColumnDefinition>
                <ColumnDefinition Width="1*"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Row="0" Grid.ColumnSpan="2">
                <WrapPanel>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="30"  Width="30" Margin="10,0,0,0"   Click="btnSameGOrder_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                            <Button.Background>
                                <ImageBrush ImageSource="/IntexReportClient;component/Images/Add.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  Grid.Column="1" Text="{Binding Source={Localization:Translate Word=加入}}" ></TextBlock>
                    </Grid> 
                    <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnRemove_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Delete.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=移除}}" ></TextBlock>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="30"  Width="30" Margin="10,0,0,0"   Click="btnPreplan_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                            <Button.Background>
                                <ImageBrush ImageSource="/IntexReportClient;component/Images/Reload.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock   Grid.Column="1"  Text="{Binding Source={Localization:Translate Word=创建领纱单}}" ></TextBlock>
                    </Grid>
                   <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="30"   Width="30" Margin="10,0,0,0"   Click="btnPrintLS_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                            <Button.Background>
                                <ImageBrush ImageSource="/IntexReportClient;component/Images/Print.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock   Grid.Column="1"  Text="{Binding Source={Localization:Translate Word=打印}}" ></TextBlock>
                   </Grid>       
                    <Grid Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="80"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=总数量}}" ></TextBlock>
                        <TextBox  Grid.Column="1" Name="txtLSQty"  Text="0" ></TextBox>
                    </Grid>
                    <Grid Visibility="Collapsed"> 
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="80"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=交期}}" ></TextBlock>
                        <TextBox  Grid.Column="1" Name="txtLSDD" Text="0" ></TextBox>
                    </Grid>
                </WrapPanel>
            </StackPanel>
            <WrapPanel Grid.Row="1" Grid.Column="0" >
                <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=待合并的领纱单}}" ></TextBlock>
            </WrapPanel>
            <WrapPanel Grid.Row="1" Grid.Column="1" >
                <TextBlock Grid.Column="1" Text="{Binding Source={Localization:Translate Word=留位}}" ></TextBlock>
            </WrapPanel>
            <DataGrid  Grid.Row="2" Grid.Column="0"
                        FontSize="12" 
                        AutoGenerateColumns="False" 
                        EnableRowVirtualization="True" 
                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwTGAAUF}}" 
                        HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto"   EnableColumnVirtualization="True" 
                        HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Grid.RowSpan="2">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABKKDAUFTNR,Converter={StaticResource ResourceKey=Trim}}" Header="花号" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=ABPART,Converter={StaticResource ResourceKey=Trim}}" Header="纱线" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE,Converter={StaticResource ResourceKey=Trim}}" Header="色号" Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=ABPWAKZ,Converter={StaticResource ResourceKey=JW}}" Header="JW" Width="Auto" />
                    <DataGridTextColumn  Binding="{Binding Path=SELLERNAME,Converter={StaticResource ResourceKey=Trim}}" Header="厂家" Width="Auto" MinWidth="10" />
                    <DataGridTextColumn  Binding="{Binding Path=SPINLOT,Converter={StaticResource ResourceKey=Trim}}" Header="批号" Width="Auto" MinWidth="10" />  
                    <DataGridTextColumn  Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}" Header="留位" Width="Auto" MinWidth="10" /> 
                </DataGrid.Columns>
            </DataGrid>
            <DataGrid   Grid.Row="2" Grid.Column="1"
                        FontSize="12"
                           Height="300"
                        AutoGenerateColumns="False" 
                        EnableRowVirtualization="True" 
                        ItemsSource="{Binding Source={StaticResource ResourceKey=vwTZUTEI}}" 
                        HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto"   EnableColumnVirtualization="True" 
                        HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns> 
                    <DataGridTextColumn Binding="{Binding Path=ZUAUFKRS}"    Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ZUAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=生产单}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ZUAUFPOS, Converter={StaticResource ResourceKey=pnum}}"    Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ZUPARTIE, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=批次}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ZULBEHI, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:TranslateExtension Word=箱号}}"  Width="Auto" /> 
                    <DataGridTextColumn Binding="{Binding Path=ZUEINTKG, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=留位}}"  Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ZUENTNKG, Converter={StaticResource ResourceKey=d1000}}" Header="{Binding Source={Localization:TranslateExtension Word=发料}}"  Width="Auto" />
                </DataGrid.Columns>
            </DataGrid>
            <TextBlock Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="2" 
                           HorizontalAlignment="Center" VerticalAlignment="Center" Name="txtMessage" Foreground="Red" Text="消息提醒" FontSize="18"></TextBlock>
        </Grid>
        <Grid Grid.Row="0"   Grid.Column="0"  >
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" /> 
                <RowDefinition   Height="1*" />
                <RowDefinition   Height="1*" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
                <WrapPanel >
                    <TextBlock Width="Auto">任务书:</TextBlock>
                    <TextBox   Name="txtVKPAUFKRS" MaxLength="2" Text="{Binding KRS}" Width="40" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink"  CharacterCasing="Upper"/>
                    <TextBox   Name="txtVKPAUFLFD" MaxLength="6" Text="{Binding LFD}" Width="80" Margin="0,0,0,0"   HorizontalAlignment="Left" />
                    <Button  Height="30"  Width="30" Margin="10,0,0,0"   Click="btnQuery_Click" KeyboardNavigation.TabIndex="3" IsDefault="True">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Reload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Margin="10,0,0,0"  Text="{Binding Source={Localization:Translate Word=刷新}}" ></TextBlock>
                </WrapPanel>
                <WrapPanel>
                    <TextBlock Margin="10,0,0,0" Text="{Binding Source={Localization:Translate Word=厂家:}}" ></TextBlock>
                    <TextBox Background="LightBlue"  FontSize="12"    KeyDown="TextBox_KeyDown"   Width="80"  Text="{Binding SELLERNAME, Source={StaticResource ResourceKey=vwGAAUF},Converter={StaticResource ResourceKey=gb2312}}"  Margin="10,0,0,0" />
                    <TextBlock Text="{Binding Source={Localization:Translate Word=批号:}}" ></TextBlock>
                    <TextBox Background="LightBlue"   KeyDown="TextBox_KeyDown"  Text="{Binding Path=SPINLOT,Source={StaticResource ResourceKey=vwGAAUF},Converter={StaticResource ResourceKey=gb2312}}" Width="60"/>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="0,0,0,0"     Click="btnBook_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="/IntexReportClient;component/Images/button_ok.png" />
                            </Button.Background>
                        </Button>
                        <TextBlock  Grid.Column="1"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="确认"  VerticalAlignment="Center" />
                    </Grid>
                    <Grid  Margin="0,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="色纱KG:"  VerticalAlignment="Center" />
                        <TextBlock Grid.Column="1" Background="LightYellow" HorizontalAlignment="Center"  Text="{Binding Path=ABPSOLLMENGE5,Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwGAAUF}}" Width="60"/>
                    </Grid>
                    <Grid  Margin="0,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="原纱KG:"  VerticalAlignment="Center" />
                        <TextBlock Grid.Column="1" Background="LightYellow" HorizontalAlignment="Center" Text="{Binding Path=GAKG1,Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwGAAUF}}" Width="100"/>
                    </Grid>
                    
                </WrapPanel>
                <WrapPanel>
                    <Grid  Margin="0,0,0,0"  Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="原料比例"  VerticalAlignment="Center" />
                        <TextBlock Grid.Column="1" Background="White"  FontSize="18" Height="Auto"    Width="40" Name="txtTRatio"   Margin="15,0,0,0" Text="0"   VerticalAlignment="Center"/>
                    </Grid>
                    <Button   Height="Auto"   Width="Auto"  Margin="0,0,0,0" Content="染损+"  VerticalAlignment="Center" Click="btnAddRatio_Click"/>
                    <TextBox Name="txtAddRatio" Background="White"   Height="Auto"   Width="60"  Margin="10,0,0,0"  VerticalAlignment="Center"
                               Text="1"  />
                    <Button   Height="Auto"   Width="Auto"  Margin="0,0,0,0" Content="重量+"  VerticalAlignment="Center" Click="btnAddQty_Click"/>
                    <TextBox  Name="txtAddQty" Background="White"   Height="Auto"   Width="60"  Margin="10,0,0,0"  VerticalAlignment="Center"
                                 Text="0" /> 
                      <Button Grid.Column="1" Height="20"  Width="20" Margin="00,0,0,0"   Click="SplinLostSet_Click" KeyboardNavigation.TabIndex="3" IsDefault="True" Visibility="Collapsed">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/button_ok.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock  Visibility="Collapsed">确认</TextBlock>
                </WrapPanel>
                <WrapPanel >
                    <Button Grid.Column="1" Height="20"  Width="20" Margin="0,0,0,0"   Click="SplinLostSetWarp_Click" KeyboardNavigation.TabIndex="3" IsDefault="True"  Visibility="Collapsed">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Convert.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock  Visibility="Collapsed">所有经纱</TextBlock>
                    <Button Grid.Column="1" Height="20"  Width="20" Margin="0,0,0,0"   Click="SplinLostSetWeft_Click" KeyboardNavigation.TabIndex="3" IsDefault="True"  Visibility="Collapsed">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Convert.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock  Visibility="Collapsed">所有纬纱</TextBlock>
                    <Button Grid.Column="1" Height="20"  Width="20" Margin="0,0,0,0"   Click="SplinLostSetAll_Click" KeyboardNavigation.TabIndex="3" IsDefault="True"  Visibility="Collapsed">
                        <Button.Background>
                            <ImageBrush ImageSource="/IntexReportClient;component/Images/Convert.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock  Visibility="Collapsed">所有纱</TextBlock>
                </WrapPanel>
            </StackPanel> 
            <DataGrid Grid.Row="1" 
                      Name="dlgGAAUF"
                      ItemsSource="{Binding Source={StaticResource ResourceKey=vwGAAUF}}"    
                      FontSize="12"  
                      AutoGenerateColumns="False" EnableRowVirtualization="True"
                      HeadersVisibility="Column" CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                      Height="Auto" EnableColumnVirtualization="True" HorizontalAlignment="Left">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=ABKKDAUFTNR,Converter={StaticResource ResourceKey=Trim}}" Header="花号" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="计划单" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ABPART,Converter={StaticResource ResourceKey=Trim}}" Header="纱线" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ABPFARBE,Converter={StaticResource ResourceKey=Trim}}" Header="色号" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=ABPWAKZ,Converter={StaticResource ResourceKey=JW}}"  Header="JW" Width="Auto" MinWidth="10" />
                    <DataGridTextColumn  Binding="{Binding Path=SELLERNAME,Converter={StaticResource ResourceKey=Trim}}" Header="厂家" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn  Binding="{Binding Path=SPINLOT,Converter={StaticResource ResourceKey=Trim}}" Header="批号" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn  Binding="{Binding Path=ABPSOLLMENGE5, Converter={StaticResource ResourceKey=d100}}"  Foreground="Red"  Header="色纱kg" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn  Binding="{Binding Path=GAKG1, Converter={StaticResource ResourceKey=d100}}" Foreground="Red" Header="需求" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn  Binding="{Binding Path=GAKG3, Converter={StaticResource ResourceKey=d100}}"  Foreground="Green"  Header="留位" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn  Binding="{Binding Path=GAKG5, Converter={StaticResource ResourceKey=d100}}" Foreground="Brown"  Header="车间" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn  Binding="{Binding Path=GAKG2, Converter={StaticResource ResourceKey=d100}}" Header="预留" Width="Auto" MinWidth="30" />
                </DataGrid.Columns>
            </DataGrid>
            <Grid Grid.Row="2">
                <Grid.RowDefinitions>
                    <RowDefinition   Height="Auto" /> 
                    <RowDefinition   Height="1*" />
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0">
                    <WrapPanel>
                <ComboBox Name="cmbLot" Width="100">
                    <ComboBoxItem Content="纺批"></ComboBoxItem>
                    <ComboBoxItem Content="染批"></ComboBoxItem>
                </ComboBox>
                    
                        <TextBlock   Height="Auto"   Width="Auto"  Margin="20,0,0,0" Text="需求"  VerticalAlignment="Center" />
                        <TextBlock  Background="White"  Text="{Binding Path=GAKG1,Converter={StaticResource ResourceKey=d100},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                        <TextBlock    Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="留位"  VerticalAlignment="Center" />
                        <TextBlock  Background="White"  Text="{Binding Path=GAKG3,Converter={StaticResource ResourceKey=d100},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                        <TextBlock    Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="车间"  VerticalAlignment="Center" />
                        <TextBlock Grid.Column="1" Background="White"  Text="{Binding Path=GAKG5,Converter={StaticResource ResourceKey=d100},  Source={StaticResource ResourceKey=vwGAAUF}}"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                        <TextBlock    Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="缺口"  VerticalAlignment="Center" />
                        <TextBlock Grid.Column="1" Background="White" Name="txtRestReq" Text="0"  Height="Auto"    Width="60"     Margin="5,0,0,0"   VerticalAlignment="Center"/>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="0,0,0,0" Name="btnBook"   Click="btnAllocate_Click">
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Images/button_ok.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock  Grid.Column="1"  Height="Auto"   Width="Auto"  Margin="0,0,0,0" Text="留位"  VerticalAlignment="Center" />
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" FontSize="18" Width="30" Height="30" Margin="0,0,0,0" Name="btnRemoveBook"   Click="btnRemoveAllocate_Click">
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Images/Delete.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" VerticalAlignment="Center" Text="{Binding Source={Localization:TranslateExtension Word=取消}}"></TextBlock>
                        </Grid>
                    </WrapPanel>
                </StackPanel>
                <Grid Grid.Row="1"> 
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"></RowDefinition>
                        <RowDefinition Height="2*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>               
                    <DataGrid  Grid.Row="0" Grid.Column="0"  
                                           FontSize="12" 
                                           CanUserReorderColumns="True"  
                                           CanUserResizeRows="True" CanUserSortColumns="True"                  
                                           AutoGenerateColumns="False"   
                                           EnableRowVirtualization="True"  
                                           RowDetailsVisibilityMode="VisibleWhenSelected"   VerticalAlignment="Top"
                                           IsSynchronizedWithCurrentItem="True" VerticalScrollBarVisibility="Auto" Visibility="Visible"
                                           Name="dlgGLLG"
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwGLLG}}"   >
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="ID" Binding="{Binding GLLBEHI,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                            <DataGridTextColumn Header="P" Binding="{Binding LPLBKZ}" Width="Auto"/>
                            <DataGridTextColumn Header="厂家" Binding="{Binding Path=GLBEM, Converter={StaticResource ResourceKey=gb2312}}" Width="60"/>
                            <DataGridTextColumn Header="库存" Binding="{Binding Path=KG}" Width="Auto"/>
                            <DataGridTextColumn Header="留位" Binding="{Binding Path=ALLOKG}" Width="Auto"/>
                            <DataGridTextColumn Header="可用" Binding="{Binding Path=FREEKG}" Width="Auto"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                    <DataGrid  Grid.Row="0" Grid.Column="1" Grid.RowSpan="2"
                                           FontSize="12" 
                                           CanUserReorderColumns="True"  
                                           CanUserResizeRows="True" CanUserSortColumns="True"                  
                                           AutoGenerateColumns="False"   
                                           EnableRowVirtualization="True"  
                                           RowDetailsVisibilityMode="VisibleWhenSelected"  VerticalAlignment="Top"
                                           IsSynchronizedWithCurrentItem="True" VerticalScrollBarVisibility="Auto" Visibility="Visible" 
                                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwZUTEI}}"   >
                        <DataGrid.Columns>
                            <DataGridTextColumn   Binding="{Binding ZUAUFKRS}" Width="Auto"/>
                            <DataGridTextColumn Header="生产单" Binding="{Binding ZUAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"  />
                            <DataGridTextColumn Binding="{Binding ZUAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Width="Auto"/>
                            <DataGridTextColumn Header="仓库" Binding="{Binding Path=QLOCK}" Width="Auto"/>
                            <DataGridTextColumn Header="车间" Binding="{Binding Path=QISSUE}" Width="Auto"/> 
                        </DataGrid.Columns>
                    </DataGrid  >
                    <DataGrid  Grid.Row="1"  Grid.Column="0"
                           FontSize="12"  
                           AutoGenerateColumns="False"     
                           VerticalScrollBarVisibility="Auto"
                           VerticalAlignment="Top"
                           IsSynchronizedWithCurrentItem="True" 
                           Name="dlgYARNA"
                           ItemsSource="{Binding Source={StaticResource ResourceKey=vwYARNA}}"   >
                        <DataGrid.Columns> 
                            <DataGridTextColumn Header="纺批" Binding="{Binding GPSPPART,Converter={StaticResource ResourceKey=Trim}}" Width="Auto"/>
                            <DataGridTextColumn Header="供应商" Binding="{Binding GLBEM,Converter={StaticResource ResourceKey=Trim}}" Width="Auto"/> 
                            <DataGridTextColumn Header="库" Binding="{Binding LB}" Width="Auto"/>
                            <DataGridTextColumn Header="库存" Binding="{Binding Path=NETKG}" Width="Auto"/>
                            <DataGridTextColumn Header="留位" Binding="{Binding Path=QLOCK}" Width="Auto"/> 
                            <DataGridTextColumn Header="可用" Binding="{Binding Path=QFREE}" Width="Auto"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                </Grid>                   
            
            </Grid>
        </Grid>
    </Grid>
</UserControl>
